Add OstreeAdminBuiltinFlags for admin commands
authorMatthew Barnes <mbarnes@redhat.com>
Sun, 22 Feb 2015 20:41:02 +0000 (15:41 -0500)
committerColin Walters <walters@verbum.org>
Wed, 25 Mar 2015 21:24:06 +0000 (17:24 -0400)
Only OSTREE_ADMIN_BUILTIN_FLAG_NONE so far; does nothing.

17 files changed:
src/ostree/ot-admin-builtin-cleanup.c
src/ostree/ot-admin-builtin-deploy.c
src/ostree/ot-admin-builtin-diff.c
src/ostree/ot-admin-builtin-init-fs.c
src/ostree/ot-admin-builtin-instutil.c
src/ostree/ot-admin-builtin-os-init.c
src/ostree/ot-admin-builtin-set-origin.c
src/ostree/ot-admin-builtin-status.c
src/ostree/ot-admin-builtin-switch.c
src/ostree/ot-admin-builtin-undeploy.c
src/ostree/ot-admin-builtin-upgrade.c
src/ostree/ot-admin-instutil-builtin-grub2-generate.c
src/ostree/ot-admin-instutil-builtin-selinux-ensure-labeled.c
src/ostree/ot-admin-instutil-builtin-set-kargs.c
src/ostree/ot-builtin-admin.c
src/ostree/ot-main.c
src/ostree/ot-main.h

index be9aaf328ac89199e2efd9bbc1d8ee17321ff3f0..8607c11596d3b8d7cbed8b1d18e1052717debe9a 100644 (file)
@@ -43,7 +43,9 @@ ot_admin_builtin_cleanup (int argc, char **argv, GCancellable *cancellable, GErr
 
   context = g_option_context_new ("Delete untagged deployments and repository objects");
 
-  if (!ostree_admin_option_context_parse (context, options, &argc, &argv, &sysroot, cancellable, error))
+  if (!ostree_admin_option_context_parse (context, options, &argc, &argv,
+                                          OSTREE_ADMIN_BUILTIN_FLAG_NONE,
+                                          &sysroot, cancellable, error))
     goto out;
 
   if (!ostree_sysroot_load (sysroot, cancellable, error))
index 6c4327b79bb1115415ef41939fb90915a7e372f4..6e6acfc5dd9f07823f9a0f8bbb1c221fd7ef1a3e 100644 (file)
@@ -66,7 +66,9 @@ ot_admin_builtin_deploy (int argc, char **argv, GCancellable *cancellable, GErro
 
   context = g_option_context_new ("REFSPEC - Checkout revision REFSPEC as the new default deployment");
 
-  if (!ostree_admin_option_context_parse (context, options, &argc, &argv, &sysroot, cancellable, error))
+  if (!ostree_admin_option_context_parse (context, options, &argc, &argv,
+                                          OSTREE_ADMIN_BUILTIN_FLAG_NONE,
+                                          &sysroot, cancellable, error))
     goto out;
 
   if (argc < 2)
index 55a8911084ce7358effdb1e39a7451627c991f32..be225d9eac2b92413eeb38ddfb5443478b878c11 100644 (file)
@@ -55,7 +55,9 @@ ot_admin_builtin_diff (int argc, char **argv, GCancellable *cancellable, GError
 
   g_option_context_add_main_entries (context, options, NULL);
 
-  if (!ostree_admin_option_context_parse (context, options, &argc, &argv, &sysroot, cancellable, error))
+  if (!ostree_admin_option_context_parse (context, options, &argc, &argv,
+                                          OSTREE_ADMIN_BUILTIN_FLAG_NONE,
+                                          &sysroot, cancellable, error))
     goto out;
   
   if (!ostree_sysroot_load (sysroot, cancellable, error))
index 9fe46f4ca4612224e2a47ebdba075a1c52d72474..c6e76bec72d8dd8dd68582935620d5379be2576d 100644 (file)
@@ -48,7 +48,9 @@ ot_admin_builtin_init_fs (int argc, char **argv, GCancellable *cancellable, GErr
 
   context = g_option_context_new ("PATH - Initialize a root filesystem");
 
-  if (!ostree_admin_option_context_parse (context, options, &argc, &argv, &sysroot, cancellable, error))
+  if (!ostree_admin_option_context_parse (context, options, &argc, &argv,
+                                          OSTREE_ADMIN_BUILTIN_FLAG_NONE,
+                                          &sysroot, cancellable, error))
     goto out;
 
   if (argc < 2)
index ba4d9b428018a6ff15c6d1a6a935bdbcaeecc6f5..2d40487215f11bbdf65580ba784acaa027cd29e0 100644 (file)
@@ -116,7 +116,9 @@ ot_admin_builtin_instutil (int argc, char **argv, GCancellable *cancellable, GEr
       context = ostree_admin_instutil_option_context_new_with_commands ();
 
       /* This will not return for some options (e.g. --version). */
-      if (ostree_admin_option_context_parse (context, NULL, &argc, &argv, NULL, cancellable, error))
+      if (ostree_admin_option_context_parse (context, NULL, &argc, &argv,
+                                             OSTREE_ADMIN_BUILTIN_FLAG_NONE,
+                                             NULL, cancellable, error))
         {
           if (subcommand_name == NULL)
             {
index 38a4de10e087ac85fafec68cf26a235b9dc6cd31..2927fe78bfc40fcfc6aed3e0f360916dd52c5cc3 100644 (file)
@@ -46,7 +46,9 @@ ot_admin_builtin_os_init (int argc, char **argv, GCancellable *cancellable, GErr
 
   context = g_option_context_new ("OSNAME - Initialize empty state for given operating system");
 
-  if (!ostree_admin_option_context_parse (context, options, &argc, &argv, &sysroot, cancellable, error))
+  if (!ostree_admin_option_context_parse (context, options, &argc, &argv,
+                                          OSTREE_ADMIN_BUILTIN_FLAG_NONE,
+                                          &sysroot, cancellable, error))
     goto out;
 
   if (!ostree_sysroot_ensure_initialized (sysroot, cancellable, error))
index 3beed86aebf6bd31361f7acf3b08439e1bca2bb6..21d8ac9c18ffd9acbe5ac1c6c6c1151d71c13492 100644 (file)
@@ -55,7 +55,9 @@ ot_admin_builtin_set_origin (int argc, char **argv, GCancellable *cancellable, G
 
   context = g_option_context_new ("REMOTENAME URL [BRANCH]");
 
-  if (!ostree_admin_option_context_parse (context, options, &argc, &argv, &sysroot, cancellable, error))
+  if (!ostree_admin_option_context_parse (context, options, &argc, &argv,
+                                          OSTREE_ADMIN_BUILTIN_FLAG_NONE,
+                                          &sysroot, cancellable, error))
     goto out;
 
   if (argc < 3)
index 382c5e61513bb9e05ec1b71cd69636e44e93cb8d..d0b1aed4ba2e236d5148ef12104b63d644a46b4d 100644 (file)
@@ -62,7 +62,9 @@ ot_admin_builtin_status (int argc, char **argv, GCancellable *cancellable, GErro
 
   context = g_option_context_new ("List deployments");
 
-  if (!ostree_admin_option_context_parse (context, options, &argc, &argv, &sysroot, cancellable, error))
+  if (!ostree_admin_option_context_parse (context, options, &argc, &argv,
+                                          OSTREE_ADMIN_BUILTIN_FLAG_NONE,
+                                          &sysroot, cancellable, error))
     goto out;
 
   if (!ostree_sysroot_load (sysroot, cancellable, error))
index ff9d6e9d58c90b6b0bf2a19be7261ac62bf3b0ff..7cfaebf9e2b2a7dc81bd6421c71413252e8e1b62 100644 (file)
@@ -68,7 +68,9 @@ ot_admin_builtin_switch (int argc, char **argv, GCancellable *cancellable, GErro
 
   context = g_option_context_new ("REF - Construct new tree from current origin and deploy it, if it changed");
 
-  if (!ostree_admin_option_context_parse (context, options, &argc, &argv, &sysroot, cancellable, error))
+  if (!ostree_admin_option_context_parse (context, options, &argc, &argv,
+                                          OSTREE_ADMIN_BUILTIN_FLAG_NONE,
+                                          &sysroot, cancellable, error))
     goto out;
 
   if (argc < 2)
index 9196e5bf55c78acb267080177bf59b8d9453819f..be864b133337d975d1438e60aeefba1a2f3cc1a9 100644 (file)
@@ -46,7 +46,9 @@ ot_admin_builtin_undeploy (int argc, char **argv, GCancellable *cancellable, GEr
 
   context = g_option_context_new ("INDEX - Delete deployment INDEX");
 
-  if (!ostree_admin_option_context_parse (context, options, &argc, &argv, &sysroot, cancellable, error))
+  if (!ostree_admin_option_context_parse (context, options, &argc, &argv,
+                                          OSTREE_ADMIN_BUILTIN_FLAG_NONE,
+                                          &sysroot, cancellable, error))
     goto out;
 
   if (argc < 2)
index 5ccd0b34a2f6eb678cb34570ce926b2820eb304c..a1e4aa349a22a29cf42588e8ef1ce9288d093d0d 100644 (file)
@@ -67,7 +67,9 @@ ot_admin_builtin_upgrade (int argc, char **argv, GCancellable *cancellable, GErr
 
   context = g_option_context_new ("Construct new tree from current origin and deploy it, if it changed");
 
-  if (!ostree_admin_option_context_parse (context, options, &argc, &argv, &sysroot, cancellable, error))
+  if (!ostree_admin_option_context_parse (context, options, &argc, &argv,
+                                          OSTREE_ADMIN_BUILTIN_FLAG_NONE,
+                                          &sysroot, cancellable, error))
     goto out;
 
   if (!ostree_sysroot_load (sysroot, cancellable, error))
index 617b16085b1ab542a2717ade99f688a009d15b57..3af1f34e596bc939883a3929410d8779a7ee10c2 100644 (file)
@@ -47,7 +47,9 @@ ot_admin_instutil_builtin_grub2_generate (int argc, char **argv, GCancellable *c
 
   context = g_option_context_new ("[BOOTVERSION] - generate GRUB2 configuration from given BLS entries");
 
-  if (!ostree_admin_option_context_parse (context, options, &argc, &argv, &sysroot, cancellable, error))
+  if (!ostree_admin_option_context_parse (context, options, &argc, &argv,
+                                          OSTREE_ADMIN_BUILTIN_FLAG_NONE,
+                                          &sysroot, cancellable, error))
     goto out;
 
   if (argc >= 2)
index 7e9ca0600062ab5dee0e16259597a735085c65eb..130cf3bcfe0fff9dbdc16a514483215facc2896c 100644 (file)
@@ -194,7 +194,9 @@ ot_admin_instutil_builtin_selinux_ensure_labeled (int argc, char **argv, GCancel
 
   context = g_option_context_new ("[SUBPATH PREFIX] - relabel all or part of a deployment");
 
-  if (!ostree_admin_option_context_parse (context, options, &argc, &argv, &sysroot, cancellable, error))
+  if (!ostree_admin_option_context_parse (context, options, &argc, &argv,
+                                          OSTREE_ADMIN_BUILTIN_FLAG_NONE,
+                                          &sysroot, cancellable, error))
     goto out;
 
   if (!ostree_sysroot_load (sysroot, cancellable, error))
index cef524284a2479b04017167badf89b04ae8d2aee..9bbad88ba361b3f82068ec9916d3e4046ea19b71 100644 (file)
@@ -56,7 +56,9 @@ ot_admin_instutil_builtin_set_kargs (int argc, char **argv, GCancellable *cancel
 
   context = g_option_context_new ("ARGS - set new kernel command line arguments");
 
-  if (!ostree_admin_option_context_parse (context, options, &argc, &argv, &sysroot, cancellable, error))
+  if (!ostree_admin_option_context_parse (context, options, &argc, &argv,
+                                          OSTREE_ADMIN_BUILTIN_FLAG_NONE,
+                                          &sysroot, cancellable, error))
     goto out;
 
   if (!ostree_sysroot_load (sysroot, cancellable, error))
index b194143cdff39445647469c97a127e2d4f12ec8d..6cc638466c09c213b38afbf40c31734763a5c967 100644 (file)
@@ -130,7 +130,9 @@ ostree_builtin_admin (int argc, char **argv, GCancellable *cancellable, GError *
       context = ostree_admin_option_context_new_with_commands ();
 
       /* This will not return for some options (e.g. --version). */
-      if (ostree_admin_option_context_parse (context, NULL, &argc, &argv, NULL, cancellable, error))
+      if (ostree_admin_option_context_parse (context, NULL, &argc, &argv,
+                                             OSTREE_ADMIN_BUILTIN_FLAG_NONE,
+                                             NULL, cancellable, error))
         {
           if (subcommand_name == NULL)
             {
index 94d29ca6a947ed1d2f84714a4d242a2e5a68845d..b1ad20e0e7700a125a3eb4e12d4ab31facbdfce5 100644 (file)
@@ -308,6 +308,7 @@ ostree_admin_option_context_parse (GOptionContext *context,
                                    const GOptionEntry *main_entries,
                                    int *argc,
                                    char ***argv,
+                                   OstreeAdminBuiltinFlags flags,
                                    OstreeSysroot **out_sysroot,
                                    GCancellable *cancellable,
                                    GError **error)
index 659727f38aa7a65d5025868f73da9bb87de735ca..b1c58a0479a8856964eada8d23e97622e5bd9898 100644 (file)
@@ -30,6 +30,10 @@ typedef enum {
   OSTREE_BUILTIN_FLAG_NO_CHECK = 1 << 1
 } OstreeBuiltinFlags;
 
+typedef enum {
+  OSTREE_ADMIN_BUILTIN_FLAG_NONE = 0,
+} OstreeAdminBuiltinFlags;
+
 typedef struct {
   const char *name;
   gboolean (*fn) (int argc, char **argv, GCancellable *cancellable, GError **error);
@@ -49,6 +53,7 @@ gboolean ostree_option_context_parse (GOptionContext *context,
 gboolean ostree_admin_option_context_parse (GOptionContext *context,
                                             const GOptionEntry *main_entries,
                                             int *argc, char ***argv,
+                                            OstreeAdminBuiltinFlags flags,
                                             OstreeSysroot **out_sysroot,
                                             GCancellable *cancellable, GError **error);